home *** CD-ROM | disk | FTP | other *** search
/ Enter 2001 September / EnterCD9.iso / Off-line / w01 / c64games_page - enter / overlib.js < prev    next >
Encoding:
JavaScript  |  2001-05-06  |  32.9 KB  |  1,160 lines

  1. ////////////////////////////////////////////////////////////////////////////////////
  2. //  overLIB 3.10  --  This notice must be left untouched at all times.
  3. //  Copyright Erik Bosrup 1998-2000. All rights reserved.
  4. //
  5. //  By Erik Bosrup (erik@bosrup.com).  Last modified 2000-03-30.
  6. //  Portions by Dan Steinman (dansteinman.com).
  7. //  Additions by other people are listed on the overLIB homepage.
  8. //
  9. //  Get the latest version at http://www.bosrup.com/web/overlib/
  10. //
  11. //  This script is published under an open source license. Please read the license
  12. //  agreement online at: http://www.bosrup.com/web/overlib/license.html
  13. //  If you have questions regard the license please contact erik@bosrup.com.
  14. //
  15. //  This script library was originally created for personal use. By request it has
  16. //  later been made public. This is free software. Do not try to sell this as your
  17. //  own work, or remove this copyright notice. For full details on copying this
  18. //  script please read the license agreement at the link above.
  19. //
  20. //  Please give credit on sites that use overLIB and submit changes of the script
  21. //  so other people can use them as well. This script is free to use, don't abuse.
  22. ////////////////////////////////////////////////////////////////////////////////////
  23.  
  24.  
  25. ////////////////////////////////////////////////////////////////////////////////////
  26. // CONSTANTS
  27. // Don't touch these. :)
  28. ////////////////////////////////////////////////////////////////////////////////////
  29. var INARRAY    =  1;
  30. var CAPARRAY    =  2;
  31. var STICKY    =  3;
  32. var BACKGROUND    =  4;
  33. var NOCLOSE    =  5;
  34. var CAPTION    =  6;
  35. var LEFT    =  7;
  36. var RIGHT    =  8;
  37. var CENTER    =  9;
  38. var OFFSETX    =  10;
  39. var OFFSETY    =  11;
  40. var FGCOLOR    =  12;
  41. var BGCOLOR    =  13;
  42. var TEXTCOLOR    =  14;
  43. var CAPCOLOR    =  15;
  44. var CLOSECOLOR    =  16;
  45. var WIDTH    =  17;
  46. var BORDER    =  18;
  47. var STATUS    =  19;
  48. var AUTOSTATUS    =  20;
  49. var AUTOSTATUSCAP  =  21;
  50. var HEIGHT    =  22;
  51. var CLOSETEXT    =  23;
  52. var SNAPX    =  24;
  53. var SNAPY    =  25;
  54. var FIXX    =  26;
  55. var FIXY    =  27;
  56. var FGBACKGROUND  =  28;
  57. var BGBACKGROUND  =  29;
  58. var PADX    =  30;
  59. var PADY    =  31;
  60. var PADX2    =  32;
  61. var PADY2    =  33;
  62. var FULLHTML    =  34;
  63. var ABOVE    =  35;
  64. var BELOW    =  36;
  65. var CAPICON    =  37;
  66. var TEXTFONT    =  38;
  67. var CAPTIONFONT    =  39;
  68. var CLOSEFONT    =  40;
  69. var TEXTSIZE    =  41;
  70. var CAPTIONSIZE    =  42;
  71. var CLOSESIZE    =  43;
  72. var FRAME    =  44;
  73.  
  74.  
  75.  
  76. ////////////////////////////////////////////////////////////////////////////////////
  77. // DEFAULT CONFIGURATION
  78. // You don't have to change anything here if you don't want to. All of this can be
  79. // changed on your html page or through an overLIB call.
  80. ////////////////////////////////////////////////////////////////////////////////////
  81.  
  82. // Main background color (the large area)
  83. // Usually a bright color (white, yellow etc)
  84. if (typeof ol_fgcolor == 'undefined') { var ol_fgcolor = "#FF3333";}
  85.   
  86. // Border color and color of caption
  87. // Usually a dark color (black, brown etc)
  88. if (typeof ol_bgcolor == 'undefined') { var ol_bgcolor = "#CC0000";}
  89.   
  90. // Text color
  91. // Usually a dark color
  92. if (typeof ol_textcolor == 'undefined') { var ol_textcolor = "#FFFFFF";}
  93.   
  94. // Color of the caption text
  95. // Usually a bright color
  96. if (typeof ol_capcolor == 'undefined') { var ol_capcolor = "#FFFFFF";}
  97.   
  98. // Color of "Close" when using Sticky
  99. // Usually a semi-bright color
  100. if (typeof ol_closecolor == 'undefined') { var ol_closecolor = "#9999FF";}
  101.  
  102. // Font face for the main text
  103. if (typeof ol_textfont == 'undefined') { var ol_textfont = "Tahoma,Verdana,Arial,Helvetica";}
  104.  
  105. // Font face for the caption
  106. if (typeof ol_captionfont == 'undefined') { var ol_captionfont = "Tahoma,Verdana,Arial,Helvetica";}
  107.  
  108. // Font face for the close text
  109. if (typeof ol_closefont == 'undefined') { var ol_closefont = "Tahoma,Verdana,Arial,Helvetica";}
  110.  
  111. // Font size for the main text
  112. if (typeof ol_textsize == 'undefined') { var ol_textsize = "1";}
  113.  
  114. // Font size for the caption
  115. if (typeof ol_captionsize == 'undefined') { var ol_captionsize = "1";}
  116.  
  117. // Font size for the close text
  118. if (typeof ol_closesize == 'undefined') { var ol_closesize = "1";}
  119.  
  120. // Width of the popups in pixels
  121. // 100-300 pixels is typical
  122. if (typeof ol_width == 'undefined') { var ol_width = "90";}
  123.   
  124. // How thick the ol_border should be in pixels
  125. // 1-3 pixels is typical
  126. if (typeof ol_border == 'undefined') { var ol_border = "2";}
  127.   
  128. // How many pixels to the right/left of the cursor to show the popup
  129. // Values between 3 and 12 are best
  130. if (typeof ol_offsetx == 'undefined') { var ol_offsetx = 10;}
  131.   
  132. // How many pixels to the below the cursor to show the popup
  133. // Values between 3 and 12 are best
  134. if (typeof ol_offsety == 'undefined') { var ol_offsety = 10;}
  135.  
  136. // Default text for popups
  137. // Should you forget to pass something to overLIB this will be displayed.
  138. if (typeof ol_text == 'undefined') { var ol_text = "Default Text"; }
  139.  
  140. // Default caption
  141. // You should leave this blank or you will have problems making non caps popups.
  142. if (typeof ol_cap == 'undefined') { var ol_cap = ""; }
  143.  
  144. // Decides if sticky popups are default.
  145. // 0 for non, 1 for stickies.
  146. if (typeof ol_sticky == 'undefined') { var ol_sticky = 0; }
  147.  
  148. // Default background image. Better left empty unless you always want one.
  149. if (typeof ol_background == 'undefined') { var ol_background = ""; }
  150.  
  151. // Text for the closing sticky popups.
  152. // Normal is "Close".
  153. if (typeof ol_close == 'undefined') { var ol_close = "Close"; }
  154.  
  155. // Default vertical alignment for popups.
  156. // It's best to leave RIGHT here. Other options are LEFT and CENTER.
  157. if (typeof ol_hpos == 'undefined') { var ol_hpos = RIGHT; }
  158.  
  159. // Default status bar text when a popup is invoked.
  160. if (typeof ol_status == 'undefined') { var ol_status = ""; }
  161.  
  162. // If the status bar automatically should load either text or caption.
  163. // 0=nothing, 1=text, 2=caption
  164. if (typeof ol_autostatus == 'undefined') { var ol_autostatus = 0; }
  165.  
  166. // Default height for popup. Often best left alone.
  167. if (typeof ol_height == 'undefined') { var ol_height = -1; }
  168.  
  169. // Horizontal grid spacing that popups will snap to.
  170. // 0 makes no grid, anything else will cause a snap to that grid spacing.
  171. if (typeof ol_snapx == 'undefined') { var ol_snapx = 0; }
  172.  
  173. // Vertical grid spacing that popups will snap to.
  174. // 0 makes no grid, andthing else will cause a snap to that grid spacing.
  175. if (typeof ol_snapy == 'undefined') { var ol_snapy = 0; }
  176.  
  177. // Sets the popups horizontal position to a fixed column.
  178. // Anything above -1 will cause fixed position.
  179. if (typeof ol_fixx == 'undefined') { var ol_fixx = -1; }
  180.  
  181. // Sets the popups vertical position to a fixed row.
  182. // Anything above -1 will cause fixed position.
  183. if (typeof ol_fixy == 'undefined') { var ol_fixy = -1; }
  184.  
  185. // Background image for the popups inside.
  186. if (typeof ol_fgbackground == 'undefined') { var ol_fgbackground = ""; }
  187.  
  188. // Background image for the popups frame.
  189. if (typeof ol_bgbackground == 'undefined') { var ol_bgbackground = ""; }
  190.  
  191. // How much horizontal left padding text should get by default when BACKGROUND is used.
  192. if (typeof ol_padxl == 'undefined') { var ol_padxl = 1; }
  193.  
  194. // How much horizontal right padding text should get by default when BACKGROUND is used.
  195. if (typeof ol_padxr == 'undefined') { var ol_padxr = 1; }
  196.  
  197. // How much vertical top padding text should get by default when BACKGROUND is used.
  198. if (typeof ol_padyt == 'undefined') { var ol_padyt = 1; }
  199.  
  200. // How much vertical bottom padding text should get by default when BACKGROUND is used.
  201. if (typeof ol_padyb == 'undefined') { var ol_padyb = 1; }
  202.  
  203. // If the user by default must supply all html for complete popup control.
  204. // Set to 1 to activate, 0 otherwise.
  205. if (typeof ol_fullhtml == 'undefined') { var ol_fullhtml = 0; }
  206.  
  207. // Allow overLIB to load usage images. Set to zero to stop.
  208. if (typeof o3_tracker == 'undefined') { var o3_tracker = 0; }
  209.  
  210. // Default vertical position of the popup. Default should normally be BELOW.
  211. // ABOVE only works when HEIGHT is defined.
  212. if (typeof ol_vpos == 'undefined') { var ol_vpos = BELOW; }
  213.  
  214. // Default height of popup to use when placing the popup above the cursor.
  215. if (typeof ol_aboveheight == 'undefined') { var ol_aboveheight = 0; }
  216.  
  217. // Default icon to place next to the popups caption.
  218. if (typeof ol_caption == 'undefined') { var ol_capicon = ""; }
  219.  
  220. // Default frame. We default to current frame if there is no frame defined.
  221. if (typeof ol_frame == 'undefined') { var ol_frame = self; }
  222.  
  223.  
  224.  
  225. ////////////////////////////////////////////////////////////////////////////////////
  226. // ARRAY CONFIGURATION
  227. // You don't have to change anything here if you don't want to. The following
  228. // arrays can be filled with text and html if you don't wish to pass it from
  229. // your html page.
  230. ////////////////////////////////////////////////////////////////////////////////////
  231.  
  232. // Array with texts.
  233. var ol_texts = new Array("Array Text 0", "Array Text 1");
  234.  
  235. // Array with captions.
  236. var ol_caps = new Array("Array Caption 0", "Array Caption 1");
  237.  
  238.  
  239.  
  240.  
  241.  
  242.  
  243. ////////////////////////////////////////////////////////////////////////////////////
  244. // END CONFIGURATION
  245. ////////////////////////////////////////////////////////////////////////////////////
  246.  
  247.  
  248.  
  249. ////////////////////////////////////////////////////////////////////////////////////
  250. // INIT
  251. ////////////////////////////////////////////////////////////////////////////////////
  252.  
  253.  
  254. // Runtime variables init. Used for runtime only, don't change, not for config!
  255. var o3_text = "";
  256. var o3_cap = "";
  257. var o3_sticky = 0;
  258. var o3_background = "";
  259. var o3_close = "Close";
  260. var o3_hpos = RIGHT;
  261. var o3_offsetx = 2;
  262. var o3_offsety = 2;
  263. var o3_fgcolor = "";
  264. var o3_bgcolor = "";
  265. var o3_textcolor = "";
  266. var o3_capcolor = "";
  267. var o3_closecolor = "";
  268. var o3_width = 100;
  269. var o3_border = 1;
  270. var o3_status = "";
  271. var o3_autostatus = 0;
  272. var o3_height = -1;
  273. var o3_snapx = 0;
  274. var o3_snapy = 0;
  275. var o3_fixx = -1;
  276. var o3_fixy = -1;
  277. var o3_fgbackground = "";
  278. var o3_bgbackground = "";
  279. var o3_padxl = 0;
  280. var o3_padxr = 0;
  281. var o3_padyt = 0;
  282. var o3_padyb = 0;
  283. var o3_fullhtml = 0;
  284. var o3_vpos = BELOW;
  285. var o3_aboveheight = 0;
  286. var o3_capicon = "";
  287. var o3_textfont = "Verdana,Arial,Helvetica";
  288. var o3_captionfont = "Verdana,Arial,Helvetica";
  289. var o3_closefont = "Verdana,Arial,Helvetica";
  290. var o3_textsize = "1";
  291. var o3_captionsize = "1";
  292. var o3_closesize = "1";
  293. var o3_frame = self;
  294.  
  295.  
  296.  
  297. // Display state variables
  298. var o3_x = 0;
  299. var o3_y = 0;
  300. var o3_allowmove = 0;
  301. var o3_showingsticky = 0;
  302. var o3_removecounter = 0;
  303.  
  304. // Our layer
  305. var over = null;
  306.  
  307.  
  308. // Decide browser version
  309. var ns4 = (document.layers)? true:false
  310. var ie4 = (document.all)? true:false
  311. var ie5 = false;
  312.  
  313. // Microsoft Stupidity Check(tm).
  314. if (ie4) {
  315.   if (navigator.userAgent.indexOf('MSIE 5')>0) {
  316.     ie5 = true;
  317.   }
  318. }
  319.  
  320.  
  321. // Capture events, alt. diffuses the overlib function.
  322. if ( (ns4) || (ie4) ) {
  323.   document.onmousemove = mouseMove
  324.   if (ns4) document.captureEvents(Event.MOUSEMOVE)
  325. } else {
  326.   overlib  = no_overlib;
  327.   nd       = no_overlib;
  328.   ver3fix  = true;
  329. }
  330.  
  331.  
  332. // Fake function for 3.0 users.
  333. function no_overlib() {
  334.   return ver3fix;
  335. }
  336.  
  337.  
  338.  
  339. ////////////////////////////////////////////////////////////////////////////////////
  340. // PUBLIC FUNCTIONS
  341. ////////////////////////////////////////////////////////////////////////////////////
  342.  
  343.  
  344. // overlib(arg0, ..., argN)
  345. // Loads parameters into global runtime variables.
  346. function overlib() {
  347.   
  348.   // Load defaults to runtime.
  349.   o3_text = ol_text;
  350.   o3_cap = ol_cap;
  351.   o3_sticky = ol_sticky;
  352.   o3_background = ol_background;
  353.   o3_close = ol_close;
  354.   o3_hpos = ol_hpos;
  355.   o3_offsetx = ol_offsetx;
  356.   o3_offsety = ol_offsety;
  357.   o3_fgcolor = ol_fgcolor;
  358.   o3_bgcolor = ol_bgcolor;
  359.   o3_textcolor = ol_textcolor;
  360.   o3_capcolor = ol_capcolor;
  361.   o3_closecolor = ol_closecolor;
  362.   o3_width = ol_width;
  363.   o3_border = ol_border;
  364.   o3_status = ol_status;
  365.   o3_autostatus = ol_autostatus;
  366.   o3_height = ol_height;
  367.   o3_snapx = ol_snapx;
  368.   o3_snapy = ol_snapy;
  369.   o3_fixx = ol_fixx;
  370.   o3_fixy = ol_fixy;
  371.   o3_fgbackground = ol_fgbackground;
  372.   o3_bgbackground = ol_bgbackground;
  373.   o3_padxl = ol_padxl;
  374.   o3_padxr = ol_padxr;
  375.   o3_padyt = ol_padyt;
  376.   o3_padyb = ol_padyb;
  377.   o3_fullhtml = ol_fullhtml;
  378.   o3_vpos = ol_vpos;
  379.   o3_aboveheight = ol_aboveheight;
  380.   o3_capicon = ol_capicon;
  381.   o3_textfont = ol_textfont;
  382.   o3_captionfont = ol_captionfont;
  383.   o3_closefont = ol_closefont;
  384.   o3_textsize = ol_textsize;
  385.   o3_captionsize = ol_captionsize;
  386.   o3_closesize = ol_closesize;
  387.  
  388.   // Special for frame support, over must be reset...
  389.   if ( (ns4) || (ie4) ) {
  390.     o3_frame = ol_frame;
  391.     if (ns4) over = o3_frame.document.overDiv
  392.     if (ie4) over = o3_frame.overDiv.style
  393.   }
  394.   
  395.   
  396.   // What the next argument is expected to be.
  397.   var parsemode = -1;
  398.  
  399.   for (i = 0; i < arguments.length; i++) {
  400.     
  401.     if (parsemode == 0) {
  402.       // Arg is command
  403.       if (arguments[i] == INARRAY) { parsemode = INARRAY; }
  404.       if (arguments[i] == CAPARRAY) { parsemode = CAPARRAY; }
  405.       if (arguments[i] == STICKY) { parsemode = opt_STICKY(arguments[i]); }
  406.       if (arguments[i] == BACKGROUND) { parsemode = BACKGROUND; }
  407.       if (arguments[i] == NOCLOSE) { parsemode = opt_NOCLOSE(arguments[i]); }
  408.       if (arguments[i] == CAPTION) { parsemode = CAPTION; }
  409.       if (arguments[i] == LEFT) { parsemode = opt_HPOS(arguments[i]); }
  410.       if (arguments[i] == RIGHT) { parsemode = opt_HPOS(arguments[i]); }
  411.       if (arguments[i] == CENTER) { parsemode = opt_HPOS(arguments[i]); }
  412.       if (arguments[i] == OFFSETX) { parsemode = OFFSETX; }
  413.       if (arguments[i] == OFFSETY) { parsemode = OFFSETY; }
  414.       if (arguments[i] == FGCOLOR) { parsemode = FGCOLOR; }
  415.       if (arguments[i] == BGCOLOR) { parsemode = BGCOLOR; }
  416.       if (arguments[i] == TEXTCOLOR) { parsemode = TEXTCOLOR; }
  417.       if (arguments[i] == CAPCOLOR) { parsemode = CAPCOLOR; }
  418.       if (arguments[i] == CLOSECOLOR) { parsemode = CLOSECOLOR; }
  419.       if (arguments[i] == WIDTH) { parsemode = WIDTH; }
  420.       if (arguments[i] == BORDER) { parsemode = BORDER; }
  421.       if (arguments[i] == STATUS) { parsemode = STATUS; }
  422.       if (arguments[i] == AUTOSTATUS) { parsemode = opt_AUTOSTATUS(arguments[i]); }
  423.       if (arguments[i] == AUTOSTATUSCAP) { parsemode = opt_AUTOSTATUSCAP(arguments[i]); }
  424.       if (arguments[i] == HEIGHT) { parsemode = HEIGHT; }
  425.       if (arguments[i] == CLOSETEXT) { parsemode = CLOSETEXT; }
  426.       if (arguments[i] == SNAPX) { parsemode = SNAPX; }
  427.       if (arguments[i] == SNAPY) { parsemode = SNAPY; }
  428.       if (arguments[i] == FIXX) { parsemode = FIXX; }
  429.       if (arguments[i] == FIXY) { parsemode = FIXY; }
  430.       if (arguments[i] == FGBACKGROUND) { parsemode = FGBACKGROUND; }
  431.       if (arguments[i] == BGBACKGROUND) { parsemode = BGBACKGROUND; }
  432.       if (arguments[i] == PADX) { parsemode = PADX; }
  433.       if (arguments[i] == PADY) { parsemode = PADY; }
  434.       if (arguments[i] == FULLHTML) { parsemode = opt_FULLHTML(arguments[i]); }
  435.       if (arguments[i] == ABOVE) { parsemode = opt_VPOS(arguments[i]); }
  436.       if (arguments[i] == BELOW) { parsemode = opt_VPOS(arguments[i]); }
  437.       if (arguments[i] == CAPICON) { parsemode = CAPICON; }
  438.       if (arguments[i] == TEXTFONT) { parsemode = TEXTFONT; }
  439.       if (arguments[i] == CAPTIONFONT) { parsemode = CAPTIONFONT; }
  440.       if (arguments[i] == CLOSEFONT) { parsemode = CLOSEFONT; }
  441.       if (arguments[i] == TEXTSIZE) { parsemode = TEXTSIZE; }
  442.       if (arguments[i] == CAPTIONSIZE) { parsemode = CAPTIONSIZE; }
  443.       if (arguments[i] == CLOSESIZE) { parsemode = CLOSESIZE; }
  444.       if (arguments[i] == FRAME) { parsemode = FRAME; }
  445.  
  446.  
  447.     } else {
  448.       if (parsemode < 0) {
  449.         // Arg is maintext, unless INARRAY
  450.         if (arguments[i] == INARRAY) {
  451.           parsemode = INARRAY;
  452.         } else {
  453.           o3_text = arguments[i];
  454.           parsemode = 0;
  455.         }
  456.       } else {
  457.         // Arg is option for command
  458.         if (parsemode == INARRAY) { parsemode = opt_INARRAY(arguments[i]); }
  459.         if (parsemode == CAPARRAY) { parsemode = opt_CAPARRAY(arguments[i]); }
  460.         if (parsemode == BACKGROUND) { parsemode = opt_BACKGROUND(arguments[i]); }
  461.         if (parsemode == CAPTION) { parsemode = opt_CAPTION(arguments[i]); }
  462.         if (parsemode == OFFSETX) { parsemode = opt_OFFSETX(arguments[i]); }
  463.         if (parsemode == OFFSETY) { parsemode = opt_OFFSETY(arguments[i]); }
  464.         if (parsemode == FGCOLOR) { parsemode = opt_FGCOLOR(arguments[i]); }
  465.         if (parsemode == BGCOLOR) { parsemode = opt_BGCOLOR(arguments[i]); }
  466.         if (parsemode == TEXTCOLOR) { parsemode = opt_TEXTCOLOR(arguments[i]); }
  467.         if (parsemode == CAPCOLOR) { parsemode = opt_CAPCOLOR(arguments[i]); }
  468.         if (parsemode == CLOSECOLOR) { parsemode = opt_CLOSECOLOR(arguments[i]); }
  469.         if (parsemode == WIDTH) { parsemode = opt_WIDTH(arguments[i]); }
  470.         if (parsemode == BORDER) { parsemode = opt_BORDER(arguments[i]); }
  471.         if (parsemode == STATUS) { parsemode = opt_STATUS(arguments[i]); }
  472.         if (parsemode == HEIGHT) { parsemode = opt_HEIGHT(arguments[i]); }
  473.         if (parsemode == CLOSETEXT) { parsemode = opt_CLOSETEXT(arguments[i]); }
  474.         if (parsemode == SNAPX) { parsemode = opt_SNAPX(arguments[i]); }
  475.         if (parsemode == SNAPY) { parsemode = opt_SNAPY(arguments[i]); }
  476.         if (parsemode == FIXX) { parsemode = opt_FIXX(arguments[i]); }
  477.         if (parsemode == FIXY) { parsemode = opt_FIXY(arguments[i]); }
  478.         if (parsemode == FGBACKGROUND) { parsemode = opt_FGBACKGROUND(arguments[i]); }
  479.         if (parsemode == BGBACKGROUND) { parsemode = opt_BGBACKGROUND(arguments[i]); }
  480.         if (parsemode == PADX2) { parsemode = opt_PADX2(arguments[i]); } // must be before PADX
  481.         if (parsemode == PADY2) { parsemode = opt_PADY2(arguments[i]); } // must be before PADY
  482.         if (parsemode == PADX) { parsemode = opt_PADX(arguments[i]); }
  483.         if (parsemode == PADY) { parsemode = opt_PADY(arguments[i]); }
  484.         if (parsemode == CAPICON) { parsemode = opt_CAPICON(arguments[i]); }
  485.         if (parsemode == TEXTFONT) { parsemode = opt_TEXTFONT(arguments[i]); }
  486.         if (parsemode == CAPTIONFONT) { parsemode = opt_CAPTIONFONT(arguments[i]); }
  487.         if (parsemode == CLOSEFONT) { parsemode = opt_CLOSEFONT(arguments[i]); }
  488.         if (parsemode == TEXTSIZE) { parsemode = opt_TEXTSIZE(arguments[i]); }
  489.         if (parsemode == CAPTIONSIZE) { parsemode = opt_CAPTIONSIZE(arguments[i]); }
  490.         if (parsemode == CLOSESIZE) { parsemode = opt_CLOSESIZE(arguments[i]); }
  491.         if (parsemode == FRAME) { parsemode = opt_FRAME(arguments[i]); }
  492.  
  493.       }
  494.     }
  495.   }
  496.   
  497.   return overlib310();
  498. }
  499.  
  500.  
  501.  
  502. // Clears popups if appropriate
  503. function nd() {
  504.   if ( o3_removecounter >= 1 ) { o3_showingsticky = 0 };
  505.   if ( (ns4) || (ie4) ) {
  506.     if ( o3_showingsticky == 0 ) {
  507.       o3_allowmove = 0;
  508.       hideObject(over);
  509.     } else {
  510.       o3_removecounter++;
  511.     }
  512.   }
  513.   
  514.   return true;
  515. }
  516.  
  517.  
  518.  
  519.  
  520.  
  521.  
  522.  
  523. ////////////////////////////////////////////////////////////////////////////////////
  524. // OVERLIB 3.10 FUNCTION
  525. ////////////////////////////////////////////////////////////////////////////////////
  526.  
  527.  
  528. // This function decides what it is we want to display and how we want it done.
  529. function overlib310() {
  530.  
  531.   // Make layer content
  532.   var layerhtml;
  533.   
  534.   
  535.   if (o3_background != "" || o3_fullhtml) {
  536.     // Use background instead of box.
  537.     layerhtml = ol_content_background(o3_text, o3_background, o3_fullhtml);
  538.   } else {
  539.     // They want a popup box.
  540.  
  541.     // Prepare popup background
  542.     if (o3_fgbackground != "") {
  543.       o3_fgbackground = "BACKGROUND=\""+o3_fgbackground+"\"";
  544.     }
  545.     if (o3_bgbackground != "") {
  546.       o3_bgbackground = "BACKGROUND=\""+o3_bgbackground+"\"";
  547.     }
  548.  
  549.     // Prepare popup colors
  550.     if (o3_fgcolor != "") {
  551.       o3_fgcolor = "BGCOLOR=\""+o3_fgcolor+"\"";
  552.     }
  553.     if (o3_bgcolor != "") {
  554.       o3_bgcolor = "BGCOLOR=\""+o3_bgcolor+"\"";
  555.     }
  556.  
  557.     // Prepare popup height
  558.     if (o3_height > 0) {
  559.       o3_height = "HEIGHT=" + o3_height;
  560.     } else {
  561.       o3_height = "";
  562.     }
  563.  
  564.     // Decide which kinda box.
  565.     if (o3_cap == "") {
  566.       // Plain
  567.       layerhtml = ol_content_simple(o3_text);
  568.     } else {
  569.       // With caption
  570.       if (o3_sticky) {
  571.         // Show close text
  572.         layerhtml = ol_content_caption(o3_text, o3_cap, o3_close);
  573.       } else {
  574.         // No close text
  575.         layerhtml = ol_content_caption(o3_text, o3_cap, "");
  576.       }
  577.     }
  578.   }
  579.   
  580.   // We want it to stick!
  581.   if (o3_sticky) {
  582.     o3_showingsticky = 1;
  583.     o3_removecounter = 0;
  584.   }
  585.   
  586.   // Write layer
  587.   layerWrite(layerhtml);
  588.   
  589.   // Prepare status bar
  590.   if (o3_autostatus > 0) {
  591.     o3_status = o3_text;
  592.     if (o3_autostatus > 1) {
  593.       o3_status = o3_cap;
  594.     }
  595.   }
  596.  
  597.   // When placing the layer the first time, even stickies may be moved.
  598.   o3_allowmove = 0;
  599.  
  600.   // Show layer
  601.   disp(o3_status);
  602.  
  603.   // Stickies should stay where they are.  
  604.   if (o3_sticky) {
  605.     o3_allowmove = 0;
  606.     return false;
  607.   } else {
  608.     return true;
  609.   }
  610. }
  611.  
  612.  
  613.  
  614. ////////////////////////////////////////////////////////////////////////////////////
  615. // LAYER GENERATION FUNCTIONS
  616. ////////////////////////////////////////////////////////////////////////////////////
  617.  
  618. // Makes simple table without caption
  619. function ol_content_simple(text) {
  620.   txt = "<TABLE WIDTH="+o3_width+" BORDER=0 CELLPADDING="+o3_border+" CELLSPACING=0 "+o3_bgcolor+" "+o3_height+"><TR><TD><TABLE WIDTH=100% BORDER=0 CELLPADDING=2 CELLSPACING=0 "+o3_fgcolor+" "+o3_fgbackground+" "+o3_height+"><TR><TD VALIGN=TOP><FONT FACE=\""+o3_textfont+"\" COLOR=\""+o3_textcolor+"\" SIZE=\""+o3_textsize+"\">"+text+"</FONT></TD></TR></TABLE></TD></TR></TABLE>"
  621.   set_background("");
  622.   return txt;
  623. }
  624.  
  625. // Makes table with caption and optional close link
  626. function ol_content_caption(text, title, close) {
  627.   closing = "";
  628.   if (close != "") {
  629.     closing = "<TD ALIGN=RIGHT><A HREF=\"/\" onMouseOver=\"cClick();\"><FONT COLOR=\""+o3_closecolor+"\" FACE=\""+o3_closefont+"\" SIZE=\""+o3_closesize+"\">"+close+"</FONT></A></TD>";
  630.   }
  631.   if (o3_capicon != "") {
  632.     o3_capicon = "<IMG SRC=\""+o3_capicon+"\"> ";
  633.   }
  634.   txt = "<TABLE WIDTH="+o3_width+" BORDER=0 CELLPADDING="+o3_border+" CELLSPACING=0 "+o3_bgcolor+" "+o3_bgbackground+" "+o3_height+"><TR><TD><TABLE WIDTH=100% BORDER=0 CELLPADDING=0 CELLSPACING=0><TR><TD><B><FONT COLOR=\""+o3_capcolor+"\" FACE=\""+o3_captionfont+"\" SIZE=\""+o3_captionsize+"\">"+o3_capicon+title+"</FONT></B></TD>"+closing+"</TR></TABLE><TABLE WIDTH=100% BORDER=0 CELLPADDING=2 CELLSPACING=0 "+o3_fgcolor+" "+o3_fgbackground+" "+o3_height+"><TR><TD VALIGN=TOP><FONT COLOR=\""+o3_textcolor+"\" FACE=\""+o3_textfont+"\" SIZE=\""+o3_textsize+"\">"+text+"</FONT></TD></TR></TABLE></TD></TR></TABLE>";
  635.   set_background("");
  636.   return txt;
  637. }
  638.  
  639. // Sets the background picture, padding and lost more. :)
  640. function ol_content_background(text, picture, hasfullhtml) {
  641.   if (hasfullhtml) {
  642.     txt = text;
  643.   } else {
  644.     txt = "<TABLE WIDTH="+o3_width+" BORDER=0 CELLPADDING=0 CELLSPACING=0 HEIGHT="+o3_height+"><TR><TD COLSPAN=3 HEIGHT="+o3_padyt+"></TD></TR><TR><TD WIDTH="+o3_padxl+"></TD><TD VALIGN=TOP WIDTH="+(o3_width-o3_padxl-o3_padxr)+"><FONT FACE=\""+o3_textfont+"\" COLOR=\""+o3_textcolor+"\" SIZE=\""+o3_textsize+"\">"+text+"</FONT></TD><TD WIDTH="+o3_padxr+"></TD></TR><TR><TD COLSPAN=3 HEIGHT="+o3_padyb+"></TD></TR></TABLE>";
  645.   }
  646.   set_background(picture);
  647.   return txt;
  648. }
  649.  
  650. // Loads a picture into the div.
  651. function set_background(pic) {
  652.   if (ns4) {
  653.     over.background.src = pic;
  654.   } else if(ie4) {
  655.     over.backgroundImage = "url("+pic+")";
  656.   }
  657. }
  658.  
  659.  
  660.  
  661. ////////////////////////////////////////////////////////////////////////////////////
  662. // HANDLING FUNCTIONS
  663. ////////////////////////////////////////////////////////////////////////////////////
  664.  
  665.  
  666. // Displays the popup
  667. function disp(statustext) {
  668.   if ( (ns4) || (ie4) ) {
  669.     if (o3_allowmove == 0)   {
  670.       placeLayer();
  671.       showObject(over);
  672.       o3_allowmove = 1;
  673.     }
  674.   }
  675.  
  676.   if (statustext != "") {
  677.     self.status = statustext;
  678.   }
  679. }
  680.  
  681. // Decides where we want the popup.
  682. function placeLayer() {
  683.   var placeX, placeY;
  684.   
  685.   // HORIZONTAL PLACEMENT
  686.   if (o3_fixx > -1) {
  687.     // Fixed position
  688.     placeX = o3_fixx;
  689.   } else {
  690.     // From mouse
  691.     if (o3_hpos == CENTER) { // Center
  692.       placeX = o3_x+o3_offsetx-(o3_width/2);
  693.     }
  694.     if (o3_hpos == RIGHT) { // Right
  695.       placeX = o3_x+o3_offsetx;
  696.     }
  697.     if (o3_hpos == LEFT) { // Left
  698.       placeX = o3_x-o3_offsetx-o3_width;
  699.     }
  700.   
  701.     // Snapping!
  702.     if (o3_snapx > 1) {
  703.       var snapping = placeX % o3_snapx;
  704.       if (o3_hpos == LEFT) {
  705.         placeX = placeX - (o3_snapx + snapping);
  706.       } else {
  707.         // CENTER and RIGHT
  708.         placeX = placeX + (o3_snapx - snapping);
  709.       }
  710.     }
  711.   }
  712.  
  713.   
  714.   
  715.   // VERTICAL PLACEMENT
  716.   if (o3_fixy > -1) {
  717.     // Fixed position
  718.     placeY = o3_fixy;
  719.   } else {
  720.     // From mouse
  721.     if (o3_aboveheight > 0 && o3_vpos == ABOVE) {
  722.       placeY = o3_y - (o3_aboveheight + o3_offsety);
  723.     } else {
  724.       // BELOW
  725.       placeY = o3_y + o3_offsety;
  726.     }
  727.  
  728.     // Snapping!
  729.     if (o3_snapy > 1) {
  730.       var snapping = placeY % o3_snapy;
  731.       
  732.       if (o3_aboveheight > 0 && o3_vpos == ABOVE) {
  733.         placeY = placeY - (o3_snapy + snapping);
  734.       } else {
  735.         placeY = placeY + (o3_snapy - snapping);
  736.       }
  737.     }
  738.   }
  739.  
  740.  
  741.   // Actually move the object.  
  742.   moveTo(over, placeX, placeY);
  743. }
  744.  
  745.  
  746. // Moves the layer
  747. function mouseMove(e) {
  748.   if (ns4) {o3_x=e.pageX; o3_y=e.pageY;}
  749.   if (ie4) {o3_x=event.x; o3_y=event.y;}
  750.   if (ie5) {o3_x=event.x+o3_frame.document.body.scrollLeft; o3_y=event.y+o3_frame.document.body.scrollTop;}
  751.   
  752.   if (o3_allowmove) {
  753.     placeLayer();
  754.   }
  755. }
  756.  
  757. // The Close onMouseOver function for stickies
  758. function cClick() {
  759.   hideObject(over);
  760.   o3_showingsticky=0;
  761. }
  762.  
  763.  
  764. // Usage statistics
  765. function trk() {
  766.   if ( (ns4) || (ie4) ) {
  767.       bt=new Image(1,1); bt.src="http://www.bosrup.com/web/overlib/o3/tr.gif";
  768.       
  769.   }
  770.   o3_tracker = 0;
  771. }
  772.  
  773.  
  774.  
  775.  
  776. ////////////////////////////////////////////////////////////////////////////////////
  777. // LAYER FUNCTIONS
  778. ////////////////////////////////////////////////////////////////////////////////////
  779.  
  780.  
  781. // Writes to a layer
  782. function layerWrite(txt) {
  783.         if (ns4) {
  784.                 var lyr = o3_frame.document.overDiv.document
  785.  
  786.                 lyr.write(txt)
  787.                 lyr.close()
  788.         }
  789.         else if (ie4) o3_frame.document.all["overDiv"].innerHTML = txt
  790.     if (o3_tracker) { trk(); }
  791. }
  792.  
  793. // Make an object visible
  794. function showObject(obj) {
  795.         if (ns4) obj.visibility = "show"
  796.         else if (ie4) obj.visibility = "visible"
  797. }
  798.  
  799. // Hides an object
  800. function hideObject(obj) {
  801.         if (ns4) obj.visibility = "hide"
  802.         else if (ie4) obj.visibility = "hidden"
  803.         
  804.         self.status = "";
  805. }
  806.  
  807. // Move a layer
  808. function moveTo(obj,xL,yL) {
  809.         obj.left = xL
  810.         obj.top = yL
  811. }
  812.  
  813.  
  814.  
  815.  
  816.  
  817. ////////////////////////////////////////////////////////////////////////////////////
  818. // PARSER FUNCTIONS
  819. ////////////////////////////////////////////////////////////////////////////////////
  820.  
  821.  
  822. // Sets text from array.
  823. function opt_INARRAY(id) {
  824.   o3_text = ol_texts[id];
  825.   return 0;
  826. }
  827.  
  828. // Sets caption from array.
  829. function opt_CAPARRAY(id) {
  830.   o3_cap = ol_caps[id];  
  831.   return 0;
  832. }
  833.  
  834. // Sets stickiness.
  835. function opt_STICKY(unused) {
  836.   o3_sticky = 1;
  837.   return 0;
  838. }
  839.  
  840. // Sets background picture.
  841. function opt_BACKGROUND(file) {
  842.   o3_background = file;
  843.   return 0;
  844. }
  845.  
  846. // Sets use of close text.
  847. function opt_NOCLOSE(unused) {
  848.   o3_close = "";
  849.   return 0;
  850. }
  851.  
  852. // Sets caption.
  853. function opt_CAPTION(text) {
  854.   o3_cap = text;
  855.   return 0;
  856. }
  857.  
  858. // Sets hpos, for LEFT, RIGHT and CENTER.
  859. function opt_HPOS(pos) {
  860.   o3_hpos = pos;
  861.   return 0;
  862. }
  863.  
  864. // Sets the x offset
  865. function opt_OFFSETX(offset) {
  866.   o3_offsetx = offset;
  867.   return 0;
  868. }
  869.  
  870. // Sets the y offset
  871. function opt_OFFSETY(offset) {
  872.   o3_offsety = offset;
  873.   return 0;
  874. }
  875.  
  876.  
  877. // Sets the fg color
  878. function opt_FGCOLOR(clr) {
  879.   o3_fgcolor = clr;
  880.   return 0;
  881. }
  882.  
  883. // Sets the bg color
  884. function opt_BGCOLOR(clr) {
  885.   o3_bgcolor = clr;
  886.   return 0;
  887. }
  888.  
  889. // Sets the text color
  890. function opt_TEXTCOLOR(clr) {
  891.   o3_textcolor = clr;
  892.   return 0;
  893. }
  894.  
  895. // Sets the caption color
  896. function opt_CAPCOLOR(clr) {
  897.   o3_capcolor = clr;
  898.   return 0;
  899. }
  900.  
  901. // Sets the close color
  902. function opt_CLOSECOLOR(clr) {
  903.   o3_closecolor = clr;
  904.   return 0;
  905. }
  906.  
  907. // Sets the popup width
  908. function opt_WIDTH(pixels) {
  909.   o3_width = pixels;
  910.   return 0;
  911. }
  912.  
  913. // Sets the popup border width
  914. function opt_BORDER(pixels) {
  915.   o3_border = pixels;
  916.   return 0;
  917. }
  918.  
  919. // Sets the status bar text
  920. function opt_STATUS(text) {
  921.   o3_status = text;
  922.   return 0;
  923. }
  924.  
  925. // Sets that status bar text to the text
  926. function opt_AUTOSTATUS(val) {
  927.   o3_autostatus = 1;
  928.   return 0;
  929. }
  930.  
  931. // Sets that status bar text to the caption
  932. function opt_AUTOSTATUSCAP(val) {
  933.   o3_autostatus = 2;
  934.   return 0;
  935. }
  936.  
  937. // Sets the popup height
  938. function opt_HEIGHT(pixels) {
  939.   o3_height = pixels;
  940.   o3_aboveheight = pixels;
  941.   return 0;
  942. }
  943.  
  944. // Sets the close text.
  945. function opt_CLOSETEXT(text) {
  946.   o3_close = text;
  947.   return 0;
  948. }
  949.  
  950. // Sets horizontal snapping
  951. function opt_SNAPX(pixels) {
  952.   o3_snapx = pixels;
  953.   return 0;
  954. }
  955.  
  956. // Sets vertical snapping
  957. function opt_SNAPY(pixels) {
  958.   o3_snapy = pixels;
  959.   return 0;
  960. }
  961.  
  962. // Sets horizontal position
  963. function opt_FIXX(pos) {
  964.   o3_fixx = pos;
  965.   return 0;
  966. }
  967.  
  968. // Sets vertical position
  969. function opt_FIXY(pos) {
  970.   o3_fixy = pos;
  971.   return 0;
  972. }
  973.  
  974. // Sets the fg background
  975. function opt_FGBACKGROUND(picture) {
  976.   o3_fgbackground = picture;
  977.   return 0;
  978. }
  979.  
  980. // Sets the bg background
  981. function opt_BGBACKGROUND(picture) {
  982.   o3_bgbackground = picture;
  983.   return 0;
  984. }
  985.  
  986. // Sets the left x padding for background
  987. function opt_PADX(pixels) {
  988.   o3_padxl = pixels;
  989.   return PADX2;
  990. }
  991.  
  992. // Sets the top y padding for background
  993. function opt_PADY(pixels) {
  994.   o3_padyt = pixels;
  995.   return PADY2;
  996. }
  997.  
  998. // Sets the right x padding for background
  999. function opt_PADX2(pixels) {
  1000.   o3_padxr = pixels;
  1001.   return 0;
  1002. }
  1003.  
  1004. // Sets the bottom y padding for background
  1005. function opt_PADY2(pixels) {
  1006.   o3_padyb = pixels;
  1007.   return 0;
  1008. }
  1009.  
  1010. // Sets that user provides full html.
  1011. function opt_FULLHTML(unused) {
  1012.   o3_fullhtml = 1;
  1013.   return 0;
  1014. }
  1015.  
  1016. // Sets vpos, for ABOVE and BELOW
  1017. function opt_VPOS(pos) {
  1018.   o3_vpos = pos;
  1019.   return 0;
  1020. }
  1021.  
  1022. // Sets the caption icon.
  1023. function opt_CAPICON(icon) {
  1024.   o3_capicon = icon;
  1025.   return 0;
  1026. }
  1027.  
  1028. // Sets the text font
  1029. function opt_TEXTFONT(fontname) {
  1030.   o3_textfont = fontname;
  1031.   return 0;
  1032. }
  1033.  
  1034. // Sets the caption font
  1035. function opt_CAPTIONFONT(fontname) {
  1036.   o3_captionfont = fontname;
  1037.   return 0;
  1038. }
  1039.  
  1040. // Sets the close font
  1041. function opt_CLOSEFONT(fontname) {
  1042.   o3_closefont = fontname;
  1043.   return 0;
  1044. }
  1045.  
  1046. // Sets the text font size
  1047. function opt_TEXTSIZE(fontsize) {
  1048.   o3_textsize = fontsize;
  1049.   return 0;
  1050. }
  1051.  
  1052. // Sets the caption font size
  1053. function opt_CAPTIONSIZE(fontsize) {
  1054.   o3_captionsize = fontsize;
  1055.   return 0;
  1056. }
  1057.  
  1058. // Sets the close font size
  1059. function opt_CLOSESIZE(fontsize) {
  1060.   o3_closesize = fontsize;
  1061.   return 0;
  1062. }
  1063.  
  1064. // Defines which frame we should point to.
  1065. function opt_FRAME(frm) {
  1066.   o3_frame = frm;
  1067.  
  1068.   if ( (ns4) || (ie4) ) {
  1069.     if (ns4) over = o3_frame.document.overDiv
  1070.     if (ie4) over = o3_frame.overDiv.style
  1071.   }
  1072.  
  1073.   return 0;
  1074. }
  1075.  
  1076.  
  1077.  
  1078. ////////////////////////////////////////////////////////////////////////////////////
  1079. // OVERLIB 2 COMPATABILITY FUNCTIONS
  1080. // If you aren't upgrading you can remove the below section.
  1081. ////////////////////////////////////////////////////////////////////////////////////
  1082.  
  1083. // Converts old 0=left, 1=right and 2=center into constants.
  1084. function vpos_convert(d) {
  1085.   if (d == 0) {
  1086.     d = LEFT;
  1087.   } else {
  1088.     if (d == 1) {
  1089.       d = RIGHT;
  1090.     } else {
  1091.       d = CENTER;
  1092.     }
  1093.   }
  1094.   
  1095.   return d
  1096. }
  1097.  
  1098. // Simple popup
  1099. function dts(d,text) {
  1100.   o3_hpos = vpos_convert(d);
  1101.   overlib(text, o3_hpos, CAPTION, "");
  1102. }
  1103.  
  1104. // Caption popup
  1105. function dtc(d,text, title) {
  1106.   o3_hpos = vpos_convert(d);
  1107.   overlib(text, CAPTION, title, o3_hpos);
  1108. }
  1109.  
  1110. // Sticky
  1111. function stc(d,text, title) {
  1112.   o3_hpos = vpos_convert(d);
  1113.   overlib(text, CAPTION, title, o3_hpos, STICKY);
  1114. }
  1115.  
  1116. // Simple popup right
  1117. function drs(text) {
  1118.   dts(1,text);
  1119. }
  1120.  
  1121. // Caption popup right
  1122. function drc(text, title) {
  1123.   dtc(1,text,title);
  1124. }
  1125.  
  1126. // Sticky caption right
  1127. function src(text,title) {
  1128.   stc(1,text,title);
  1129. }
  1130.  
  1131. // Simple popup left
  1132. function dls(text) {
  1133.   dts(0,text);
  1134. }
  1135.  
  1136. // Caption popup left
  1137. function dlc(text, title) {
  1138.   dtc(0,text,title);
  1139. }
  1140.  
  1141. // Sticky caption left
  1142. function slc(text,title) {
  1143.   stc(0,text,title);
  1144. }
  1145.  
  1146. // Simple popup center
  1147. function dcs(text) {
  1148.   dts(2,text);
  1149. }
  1150.  
  1151. // Caption popup center
  1152. function dcc(text, title) {
  1153.   dtc(2,text,title);
  1154. }
  1155.  
  1156. // Sticky caption center
  1157. function scc(text,title) {
  1158.   stc(2,text,title);
  1159. }
  1160.